<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>详情页</title>
</head>
<body>
    <script>
var goodlist=[
{id=111,url:'img/g1.jpg',name:'女友1号',price:2001,age:17},
{id=121,url:'img/g2.jpg',name:'女友2号',price:2002,age:16},
{id=1,url:'img/g3.jpg',name:'女友3号',price:2003,age:15},
{id=171,url:'img/g4.jpg',name:'女友4号',price:2004,age:14},         
{id=171,url:'img/g4.jpg',name:'女友5号',price:2004,age:14},         
]
var res =location.search;
res=res.substring(1)
var arr=res.split('=')
var obj={};
obj[arr[0]]=arr[1];
var res1=goodlist.filter(function(item,index){
    return item.id==obj,id
})
    </script>
    
</body>
</html>